{% import 'admin/layout.html' as layout with context -%}
{% extends 'admin/base.html' %}

{% block head_tail %}
  {{ super() }}
  <link href="{{ buildStaticUrl('/css/admin/layout.css') }}" rel="stylesheet">
  <!--<link href="{{ url_for('static', filename='admin/layout.css') }}" rel="stylesheet">-->
{% endblock %}


{% block page_body %}

  <div class="container top_bar">
      <a class="navbar-brand" href="#" style="color: white">
        欢迎使用网站管理后台！
      </a>

      {% block access_control %}
         {% if current_user.is_authenticated %}
            <div class="btn-group pull-right user-container .navbar-brand">
              <a class="btn dropdown-toggle user-name" data-toggle="dropdown" href="#">
                <i class="icon-user"></i> {{ current_user.nickname }} <span class="caret"></span>
              </a>
              <ul class="dropdown-menu">
                 <li><a href="{{ url_for('admin.logout_view') }}">退出</a></li>
              </ul>
            </div>
         {% endif %}
      {% endblock %}

   </div>

<div class="container-fluid">

  <div class="row">

    {% if current_user.is_authenticated %}
    <div class="col-md-2" role="navigation">
      <ul class="nav nav-pills nav-stacked">
       {{ layout.menu() }}
       {{ layout.menu_links() }}
      </ul>
    </div>
    {% endif %}

    {% if current_user.is_authenticated %}
      <div class="col-md-10">
    {% else %}
      <div class="col-md-12">
    {% endif %}

            {% block rightcontent %}

        <div id="content" class="row">

        {% block brand %}
        <!--<h2 id="brand">{{ admin_view.name|capitalize }}</h2>-->
        {% endblock %}
        {{ layout.messages() }}

	{% set render_ctx = h.resolve_ctx() %}

        {% block body %}{% endblock %}
        </div>

          {% endblock %}

      </div>
  </div>
</div>

{% endblock %}
